package com.howlaisi.devops.utils

// 配置yq工具
def configYq() {
    // 下载yq工具
    sh script: "wget http://172.16.0.2:31163/yq/yq_linux_amd64"
    sh script: "chmod +x yq_linux_amd64"
    sh script: "mv yq_linux_amd64 /usr/local/bin/yq"
}

def pushDockerImage(IMAGE_TAG) {
    retry(3) {
        try {
            println("推送镜像: ${IMAGE_TAG}")
            sh "docker push  ${IMAGE_TAG}"
        } catch (Exception e) {
            println("推送镜像失败，正在重试")
            // 抛出异常以触发重试
            throw e
        }
    }
}
